#include "BSampleSound.h"
#include "TestState.h"

#undef PlaySound

BSampleSound::BSampleSound()
{
	m_name = "Play Sound";
	m_clicked = false;
	m_mouseButtonWasReleased = false;
	//TheSoundManager::Instance()->LoadSound("../../Assets/pistol.wav");
}

BSampleSound::~BSampleSound()
{

}

void BSampleSound::Update()
{
	if (m_mouseDidIntersect && m_mouseButtonWasReleased)
	{
		TheTestState::Instance()->SetSound(m_filePath);
		m_sound->Play();
		m_mouseButtonWasReleased = false;
		m_mouseDidIntersect = false;
	}
}

void BSampleSound::SetName(const std::string& name)
{
	m_name = name;
}

void BSampleSound::SetFile(const std::string& fp)
{
	m_filePath = fp;
}